'''
Created on Apr 2, 2012

@author: lyle
'''

from optparse import OptionParser
import sys

options = [
           {'name' : ('-i', '--install'), 'help' : ' install package', 'nargs' : 1},
           {'name' : ('-p', '--publish'), 'help' : 'publish package', 'nargs' : 1}
           ]


def main(options, arguments):
    if options.install == None:
        print "package name should be given with -i option"
        
    if options.publish == None:
        print "package name should be given with -p option"
    
if __name__ == '__main__':
    parser = OptionParser()
    for option in options:
        param = option['name']
        del option['name']
        parser.add_option(*param, **option)
        
    options, arguments = parser.parse_args()
    sys.argv[:] = arguments
    main(options, arguments)